home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 12 / BBS in a box XII-1.iso / Files / Bus / S / S7P 3.6 Manual.sit / S7P 3.6 Manual.rsrc / TEXT_133.txt < prev    next >
Encoding:
Text File  |  1993-11-14  |  4.9 KB  |  98 lines

  1. AppleScript
  2.  
  3. Err:=AppleScript(Commands;Result)
  4.  
  5. Runs a script using AppleScript. The AppleScript editor doesn‚Äôt need to be running. The command will be executed by the default system scripting language, which will usually be AppleScript, although other languages such as Frontier‚Ñ¢ can be installed as a scripting component (see the AppleScript developer‚Äôs kit for more information). The result will be 0 if the script runs successfully, -1 if AppleScript isn‚Äôt installed, -2 if no scripting language is available, or -1753 if the script has a syntax error (other errors may be possible depending on the scripting language). You can explicitly choose a language other than AppleScript with the SetComponent command.
  6.  
  7. Example:
  8. _________________________________________________________________
  9.  $q:=char(34) ` double-quote
  10.  $cmd:=‚Äúdisplay dialog ‚Äù+$q+TextVar+$q
  11.  $err:=AppleScript($cmd;$result)
  12. _________________________________________________________________
  13.  
  14. DoScript
  15.  
  16. Err:=DoScript(Target;Command)
  17.  
  18. Sends a "do script" AppleEvent to an application which must already be running. 'Command' is a text variable, field, or literal and will be in a format specific to the receiving application. For HyperCard¬Æ, this should be any HyperTalk command. For Frontier‚Ñ¢, it should be a UserTalk command. Other applications will have different command formats. This can also be used with Excel¬Æ 4.0 to execute any function or macro. NOTE: DoScript won‚Äôt wait for the commands to complete, so if you need to synchronize operations in another application, you should use SendWithReply instead.
  19.  
  20. Example:
  21. _________________________________________________________________
  22.  if (IsRunning("WILD")=0)
  23.       $err := Launch("WILD";"")
  24.  end if
  25.  $err := MakeAddress("WILD";$ad)
  26.  if ($err = 0)
  27.       $err:=DoScript($ad;"Go To Stack 'my stack'")
  28.          $err:=DoScript($ad;"Go To Next Card")
  29.          $err:=DoScript($ad;"Print Card")
  30.          $err := DisposeAddress($ad)
  31.  end if
  32. _________________________________________________________________
  33.  
  34. Evaluate
  35.  
  36. Err:=Evaluate(Target;Command;Result)
  37.  
  38. Sends an "evaluate" message to an application and waits for the result, which will be of type TEXT. This is most often used with HyperCard¬Æ and SuperCard¬Æ.
  39.  
  40. Example:
  41. _________________________________________________________________
  42. $err:=MakeAddress("WILD";$hc)
  43. if ($err = 0)
  44.   $err:=Evaluate($hc;"the long name of the target";$result)
  45.   alert($result)
  46.   $err:=DisposeAddress($hc)
  47. end if
  48. _________________________________________________________________
  49.  
  50. Frontier
  51.  
  52. Err:=Frontier(Command;Result)
  53.  
  54. Sends a command to UserLand Frontier‚Ñ¢ (which must already be running on your machine) and returns the result or an error message. If you pass the name of a Frontier‚Ñ¢ object (such as User.Name) rather than an executable command, the contents of that object will be returned.
  55.  
  56. Example:
  57. _________________________________________________________________
  58. $err:=Frontier("User.Name";$myName)
  59. If ($err=0)
  60.   $q:=Char(34)
  61.   $err:=Frontier("msg("+$q+"Hello, "+$myname+$q+")";$rep)
  62.   $err:=Frontier("Frontier.BringToFront()";$rep)
  63.   $err:=Frontier("edit(readme)";$rep)
  64. End if 
  65. _________________________________________________________________
  66.  
  67. QuicKeys
  68.  
  69. Err:=QuicKeys(Macro Name)
  70.  
  71. Executes a QuicKeys‚Ñ¢ sequence. You must be running QuicKeys2 v2.1 or later with CEIAC. The sequence must be installed in the Universal keyset or 4th DIMENSION¬Æ's keyset. This command will also work with QuicKeys 3.0 and QuicKeys toolbox.
  72.  
  73. GetComponent
  74.  
  75. Err:=GetComponent(code)
  76.  
  77. Returns the 4-character ID of the default scripting language. For AppleScript, it will return ‚Äúascr‚Äù.
  78.  
  79. SetComponent
  80.  
  81. Err:=SetComponent(code)
  82.  
  83. Changes the default scripting language component. To use AppleScript, specify ‚Äúascr‚Äù. For QuicKeys¬Æ 3.0 use ‚ÄúQKCL‚Äù. For Frontier‚Ñ¢, use ‚ÄúLAND‚Äù. You can use the command ListComponents to obtain the list of all scripting language codes. NOTE: QuicKeys Script is not compatible with 4D 3.0.5; you must use the QuicKeys command instead to execute sequences by name. With 4D 2.2.3 you can use the AppleScript command to run QuicKeys 3.0 scripts.
  84.  
  85. ListComponents
  86.  
  87. Err:=ListComponents(type;count;codes;names)
  88.  
  89. Returns a list of all components of the specified type. ‚ÄòType‚Äô should be a 4-character component type code. If you pass a null string, it will return a list of scripting language components. ‚ÄòCount‚Äô should be a long integer variable, which will receive the number of components available. ‚ÄòCodes‚Äô should be a string array which will receive a list of 4-character component IDs. ‚ÄòNames‚Äô should be a text array which will receive the component names. If the arrays don‚Äôt exist, they will be created automatically.
  90.  
  91. Example:
  92. _________________________________________________________________
  93.  Err:=ListComponents("osa ";howmany;codes;names)
  94.  Err:=GetComponent(theCode)
  95.  Which:=FindInArray(codes;theCode)
  96.  Alert("Current scripting language is:"+names{which})
  97. _________________________________________________________________
  98.